package com.indra.archetypeweb.entity.product;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import com.indra.archetypeweb.entity.base.BaseEntity;
import com.indra.archetypeweb.entity.user.User;

@Entity
@Table(name = "product")
@NamedQueries(value = {
		@NamedQuery(name = Product.FIND_ALL, query = "select p from Product p"),
		@NamedQuery(name = Product.FIND_BY_TYPE, query = "select p from Product p where p.productType = :productType")})

public class Product extends BaseEntity {
	
	public static final String FIND_ALL = "Product.findAll";
	public static final String FIND_BY_TYPE = "Product.findByType";

	@Id
	@GeneratedValue
	private Long id;

	@NotNull
	@Size(min = 1, max = 25)
	private String name;
	
	@NotNull
	@Size(min = 1, max = 100)
	private String description;

	@NotNull
	private Date dateAdded;
	
	
	private Date dateDeleted;
	
	@NotNull
	private Float price;
	
	@NotNull
	private int productType;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getDateAdded() {
		return dateAdded;
	}

	public void setDateAdded(Date dateAdded) {
		this.dateAdded = dateAdded;
	}

	public Date getDateDeleted() {
		return dateDeleted;
	}

	public void setDateDeleted(Date dateDeleted) {
		this.dateDeleted = dateDeleted;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public int getProductType() {
		return productType;
	}

	public void setProductType(int productType) {
		this.productType = productType;
	}

	
}
